package rocketmq.spring;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class RocketMessageController {
    @Autowired
    private RocketProducer producer;

    @RequestMapping(value = "/rocket/send")
    @ResponseBody
    public String send(String msg) {
        System.out.println("send message");
        producer.send(msg);
        return "消息发送成功！";
    }
}
